package cn.edu.Day05;

import java.util.Calendar;

public class Test {
    public static String addZero(int i)
    {
        if(i<10)
        {
            return ""+0+i;
        }
        return ""+i;
    }

    public static void main(String[] args) {
        //
        // System.out.println(addZero(1));
        Calendar calendar=Calendar.getInstance();
        System.out.print(addZero(calendar.get(Calendar.YEAR))+"年");
        System.out.print(addZero((calendar.get(Calendar.MONTH)+1))+"月");
        System.out.print(addZero(calendar.get(Calendar.DAY_OF_MONTH))+"日");
        System.out.print(addZero(calendar.get(Calendar.HOUR_OF_DAY))+":");
        System.out.print(addZero(calendar.get(Calendar.MINUTE))+":");
        System.out.print(addZero(calendar.get(Calendar.SECOND)));
    }
}
